cmake_minimum_required(VERSION 3.8)
project(addcustomcommand_implicit_depends)

add_custom_command(OUTPUT cmd IMPLICIT_DEPENDS CXX ${PROJECT_SOURCE_DIR}/foo.h COMMAND g++ -o foo ${PROJECT_SOURCE_DIR}/foo.cpp)
add_custom_target(cmd_target DEPENDS cmd)
